#include <head.h>

int main(int argc, char const *argv[])
{
    int fd = open("02test.txt", O_RDWR | O_CREAT, 0666); // 以读写模式打开 并且 清空写

    OPEN_ERR(fd); // 判断是否错误

    char buff[1024];
    int Byte = 0;
    lseek(fd, 0, SEEK_SET);
    while(Byte = read(fd, buff, sizeof(buff)) != 0)
    {
        write(fd, buff, Byte);
    }
    printf("buff = %s\n", buff);

    close(fd);
    return 0;
}
